#!/usr/bin/env python
# -*- coding: utf-8 -*-

from config.database import Database
from cls.orm.main import PG
from cls.json2 import Myjson

pgObj = PG()
pgObj.get
dataBaseObj = Database()
columns = dataBaseObj.pgTableColumns('area')
columns.pop()  # 删除最后一个geom元素
print("'" + "','".join(columns) + "'")

exit(0)
for column in columns:
    ','.join(column)
sql = "select name1,st_asgeojson(geom),name1 from building2d where name1 != '' limit 10"
# return all the rows, we expect more than one
dbRows = dataBaseObj.exec(sql)

# an empty list to hold each feature of our feature collection
new_geom_collection = []

# loop through each row in result query set and add to my feature collection
# assign name field to the GeoJSON properties

for each_poly in dbRows:
    print(each_poly[1])

